//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System.Collections;
using System.Text;
using CommunityServer.Components;


namespace CommunityServer.Galleries.Components
{
	/// <summary>
	/// Generates an XML feed for specific tag(s)
	/// </summary>
	public class GalleryTagsRssWriter : GalleryRssWriter
	{

		protected string[] Tags = null;
		protected string Description = string.Empty;
	
		public GalleryTagsRssWriter(ArrayList posts, Gallery gallery, string baseUrl, string[] tags) : base(posts, gallery, baseUrl)
		{
			Tags = tags;
			Description = string.Format("{0}: {1}", ResourceManager.GetString("Tags"), string.Join(", ", Tags));
		}


		/// <summary>
		/// Appends the Tag names to Title element
		/// </summary>
		protected override string Title
		{
			get
			{
				return string.Concat(base.Title, " : ", string.Join(", ", Tags));
			}
		}

		protected override void WriteChannel()
		{
			BuildChannel(GalleryUrls.Instance().TagsBrowser(CurrentGallery.ApplicationKey, Tags), Description, CurrentGallery.DefaultLanguage);
		}

	}
}
